import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/games_classify_entity.dart';

GamesClassifyEntity $GamesClassifyEntityFromJson(Map<String, dynamic> json) {
  final GamesClassifyEntity gamesClassifyEntity = GamesClassifyEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    gamesClassifyEntity.id = id;
  }
  final String? nameZh = jsonConvert.convert<String>(json['nameZh']);
  if (nameZh != null) {
    gamesClassifyEntity.nameZh = nameZh;
  }
  final String? nameEn = jsonConvert.convert<String>(json['nameEn']);
  if (nameEn != null) {
    gamesClassifyEntity.nameEn = nameEn;
  }
  final String? nameTha = jsonConvert.convert<String>(json['nameTha']);
  if (nameTha != null) {
    gamesClassifyEntity.nameTha = nameTha;
  }
  return gamesClassifyEntity;
}

Map<String, dynamic> $GamesClassifyEntityToJson(GamesClassifyEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['nameZh'] = entity.nameZh;
  data['nameEn'] = entity.nameEn;
  data['nameTha'] = entity.nameTha;
  return data;
}

extension GamesClassifyEntityExt on GamesClassifyEntity {
  GamesClassifyEntity copyWith({
    int? id,
    String? nameZh,
    String? nameEn,
    String? nameTha,
  }) {
    return GamesClassifyEntity()
      ..id = id ?? this.id
      ..nameZh = nameZh ?? this.nameZh
      ..nameEn = nameEn ?? this.nameEn
      ..nameTha = nameTha ?? this.nameTha;
  }
}